package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.mallbean.Region;
import com.cskaoyan.service.mallservice.RegionService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.mallvo.RegionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author ked
 * @createTime 2021年05月12日 16:00:00
 */

@RestController
public class WxRegionController {

    @Autowired
    RegionService regionService;

    @GetMapping("wx/region/list")
    public BaseRespVo getRegionList(@NotNull Integer pid){
        List<Region> regions = regionService.queryAll(pid);
        return BaseRespVo.ok(regions,"成功");
    }

}
